<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>소셜커머스 모음 :: Social Curator</title>
	<link href="{{ static_path.css }}/main.css" rel="stylesheet" type="text/css"></link>
	<script type="text/javascript" src="{{ static_path.js }}/jquery-1.7.min.js"></script>
</head>
<body>
	<div align="center">
	  <div align="left"  style="width:954px;"> 
			<!-- Header start-->
			<div class="header">
				<!-- Logo -->
				<div align="center" style="margin:20px 0px 10px 0px;"><img src="{{ static_path.images }}/logo.png"></div>					
				<!-- Top menu -->
				<div id="topmenu">
					<ul id="topmenu_navi">
						<li><a class="menu_on" href="/today_coupon">오늘의 쿠폰</a></li>
						<li><a href="/today_tiled">오늘의 쿠폰(타일)</a></li>
						<li><a href="/openapi">Open API</a></li>
					</ul>
					<div id="topmenu_search">
						<div style="float:left">
							<img src="{{ static_path.images }}/topmenu_magnify.png">
						</div>
						<input type="text" id="topmenu_search_box" name="keyword" value="{{keyword}}">
					</div>
				</div>
			</div>
			<!-- Header end -->			
			<!-- Content start -->
			<div class="content">
				<div id="deal_list">
		    	</div>
		    	<div id="lastPostsLoader"></div>				    
		    </div>
			</div>			
			<!-- Content end -->		
			<!-- Bottom start -->		
			<div class="bottom">
				<img src="{{ static_path.images }}/bottom_line.png"><br>
				<div align="center">
				 	<b>Copyright © deprice4u 2011.</b><br>
					※ deprice4u는 상품에 직접 관여하지 않으며 상품 주문, 배송 및 환불의 의무와 책임은 각 판매업체에 있습니다.	
				</div>
			</div>
			<!-- Bottom end -->		
		</div>
	</div>
	<script type="text/javascript">
	var g_keyword = "{{keyword}}";
	var g_start_id = 0;
	var g_limit = 15;
	var b_is_loading = false;
	var b_has_more_data = true;
	
	$("#topmenu_search_box").keyup(function(event)
	{
      if(event.keyCode == 13)
      {
        search($("#topmenu_search_box").val());
      }
    });
    
    String.prototype.trim = function() 
    {
		return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
	}
	
	function init()
	{
		b_is_loading = false;
		b_has_more_data = true;
		g_start_id = 0;
		$('div#deal_list').empty();
	}
	
	function search(keyword)
	{
		g_keyword = keyword;	
		init();	
    	lastPostFunc();
	}
	
	function lastPostFunc() 
	{	
		if(b_has_more_data == false || b_is_loading == true)
		{
			return;
		}
		
		b_is_loading = true;
	    $('div#lastPostsLoader').html('<div align=\'center\'><img src="{{ static_path.images }}/ajax-loader.gif"></div>');	    
	    $.get("/searcher?action=extend&output=html&keyword=" + encodeURIComponent(g_keyword) + "&start=" + g_start_id,
    	function(data)
    	{
    		if(data.trim().length == "")
    		{
    			b_has_more_data = false;
    		}    		
			else if($('div#deal_list').is(':empty'))
    		{    
    			g_start_id += g_limit;	
    			$('div#deal_list').html(data);	
    		}
    		else if (data != "") 
    	    {   
    	    	g_start_id += g_limit; 
	        	$(".deal_item:last").after(data);            
	        } 
        	$('div#lastPostsLoader').empty();
        	b_is_loading = false; 
    	}); 
	}; 

	//스크롤이 끝까지 가면 자동 실행
	$(window).scroll(function()
	{ 
        if  ($(window).scrollTop() == $(document).height() - $(window).height())
        { 
          lastPostFunc(); 
        } 
	});	
	search(g_keyword);
	</script>
	
	<!-- Google Adsense -->	
	<div id="ScrollMenu" style="position:absolute; left:1316.5px; top:130px; width:160px; z-index:1; height: 600px;">
	<script type="text/javascript"><!--
google_ad_client = "ca-pub-4117634760413699";
/* deprice4u */
google_ad_slot = "1097098886";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
			
	</div>
	<script language=javascript>
		   <!--
				var yScrollThumb;
				var yMenuTop;
				
				function CheckMenuPosition()
				{
				  yScrollThumb = 970 + (document.body.clientWidth-970) /2;
				  
				  if (yScrollThumb != ScrollMenu.style.left)
				  {
				    ScrollMenu.style.left = yScrollThumb;
				  }
				  yScrollThumb = document.body.scrollTop + 40;
				  yMenuTop = parseInt ( ScrollMenu.style.top, 10); 
				
				  if ( yMenuTop == yScrollThumb) 
				  { 
				    TimeOutInterval = 500;
				  }
				  else
				  {
				    yMenuTop = ( yMenuTop + yScrollThumb) / 2;
				
				    if ( 130 >= yMenuTop)
				    {
				      ScrollMenu.style.top = 130;
				      TimeOutInterval = 500;
				   }
				    else
				    {
				      ScrollMenu.style.top = yMenuTop;
				      TimeOutInterval = 10; 
				     }
				  }
				  setTimeout ("CheckMenuPosition()", TimeOutInterval);
				}
				
				function OnLoad()
				{
				  CheckMenuPosition();
				  return true;
				}
				OnLoad();
		  //-->
		  </script>
	<!-- Google Adsense -->	
</body>